<template>
	<view class="header">
		<view class="header-title">
			<text class="title-text">{{title}}</text>
			<view class="title-input">
				<image class="input-search" src="../../static/index/index-search.png"></image>
				<input class="input-input" type="text" placeholder="搜索相关信息" />
			</view>
			<view class="title-img">
				<image class="img-item" src="../../static/index/index-message.png"></image>
				<image v-if="titleImg" class="img-item" :src="titleImg"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "header-search",
		props: {
			title: {
				type: String,
				default: "首页",
			},
			titleImg: {
				type: String,
				default: "",
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss">
	.header {
		height: 240rpx;
		padding: 0rpx 24rpx;
		background-color: #3476F1;
		border-bottom-left-radius: 40rpx;
		border-bottom-right-radius: 40rpx;

		.header-title {
			display: flex;
			justify-content: space-between;
			align-items: center;

			.title-text {
				font-size: 44rpx;
				font-weight: bold;
				color: #fff;
				margin-right: 24rpx;
			}

			.title-input {
				display: flex;
				flex: 1;
				height: 52rpx;
				align-items: center;
				background-color: #fff;
				margin-right: 24rpx;
				border-radius: 26rpx;

				.input-search {
					width: 24rpx;
					height: 24rpx;
					margin: 0 16rpx;
				}

				.input-input {
					flex: 1;
					color: #ccc;
					font-size: 24rpx;
				}
			}
			
			.title-img {
				display: flex;

				.img-item {
					width: 48rpx;
					height: 48rpx;
					margin-right: 24rpx;

					&:last-child {
						margin-right: 0rpx;
					}
				}
			}
		}
	}
</style>
